import { Swiper, SwiperQuery } from '@/types/swiper'
import { request } from '@/utils/request'

export const getSwiperList = (data: SwiperQuery) => {
  return request<{ total: number; items: Swiper[] }>({
    url: 'banner/list',
    data
  })
}

export const addSwiper = (data: Partial<Swiper>) => {
  return request({
    url: 'banner/add',
    method: 'POST',
    data
  })
}

// 修改轮播图
export const editSwiper = (data: Swiper) => {
  return request({
    url: 'banner/update',
    method: 'POST',
    data
  })
}
// 删除轮播图
export const delSwiper = (bannerid: string) => {
  return request({
    url: `banner/delete/${bannerid}`,
    method: 'DELETE'
  })
}
